##
 # Copyright (c) 2023-2025 110476592@qq.com
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions are met:
 #
 # 1. Redistributions of source code must retain the above copyright notice,
 #    this list of conditions and the following disclaimer.
 # 2. Redistributions in binary form must reproduce the above copyright notice,
 #    this list of conditions and the following disclaimer in the documentation
 #    and/or other materials provided with the distribution.
 #
 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.
 #

##
 # @file CMakeLists.txt
 # @brief 截图工具 
 # @author 110476592@qq.com 
 # @note   承接Qt项目外包定制开发。长期接收C++项目实训学徒,联系QQ：110476592。
 #

 
cmake_minimum_required(VERSION 3.5)

project(screenshot VERSION 0.1 LANGUAGES CXX)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

#设置支持c14
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS   Widgets Network)


#设置包含文件目录
include_directories(${CMAKE_SOURCE_DIR}/elwidgets/include)
include_directories(${CMAKE_CURRENT_LIST_DIR})

include(tools/tools.cmake)
include(drawboard/draw_board.cmake)
include(widgets/widgets.cmake)
include(screenshot/screenshot.cmake)
include(painter/painter.cmake)
include(common/common.cmake)

set(PROJECT_SOURCES
    ${COMMON_SRC}
    screenshot.qrc
    ${TOOLS_SRC}
    ${DRAW_BOARD_SRC}
    ${WIDGETS_SRC}
    ${SCREENSHOT_SRC}
    readme.md
    readme_zh.md
    ${PAINTER_SRC}
)

#
#add_executable(drawtool_app    ${TEACH_TOOL_SRC} main.cpp
#    )

#add_library(screenshot  STATIC  ${PROJECT_SOURCES})

add_executable(screenshot
    ${PROJECT_SOURCES}
    main.cpp
)
set_target_properties(screenshot PROPERTIES OUTPUT_NAME "screenshot")

target_link_libraries(screenshot PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Network)
target_link_libraries(screenshot PRIVATE elwidgets)


